package com.example.demo.service.impl;

import com.example.demo.entiy.Categories;
import com.example.demo.mapper.CategoriesMapper;
import com.example.demo.service.CategoriesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class CategoriesServiceImpl implements CategoriesService {

    @Autowired
    CategoriesMapper categoriesMapper;

    @Override
    public List<Categories> getAllCategoriesList() {
        return categoriesMapper.getAllCategoriesList();
    }

    @Override
    public int getIdByAidAndCid(Integer articleId, Integer categoriesId) {
        return categoriesMapper.getIdByAidAndCid(articleId,categoriesId);
    }

    @Override
    public int updateCategoriesBuId(Integer categoriesId, Integer id) {
        return categoriesMapper.updateCategoriesBuId(categoriesId,id);
    }

    @Override
    public int insertCategories(Integer articleId, Integer categoriesId) {
        return categoriesMapper.insertCategories(articleId,categoriesId);
    }

    @Override
    public int deleteByArticleId(Integer articleId) {
        return categoriesMapper.deleteByArticleId(articleId);
    }
}
